#ifndef CVECTOR_H_
#define CVECTOR_H_

#include "cmath.h"
#include "cvectorbase.h"
#include "../exception/cinvalidsizeexception.h"

/**
 * CVector - class representing N-dimensional vector
 * @author Michal Rost
 * @date 10.01.2007
 */
template <typename T>
class CVector : public CVectorBase<T> {
public:
  CVector();
  CVector(TIndex size);
  CVector(TIndex size, T items[]);
  CVector(const CVector<T> &v);
  CVector(const CVectorBase<T> &v);
  virtual ~CVector();
  CVector<T>& operator = (const CVector<T> &v);
  CVector<T>& operator += (const CVector<T> &v);
  CVector<T>& operator -= (const CVector<T> &v);
  CVector<T> operator + (const CVector<T> &v) const;
  CVector<T> operator - (const CVector<T> &v) const;
  CVector<T> operator * (T num) const;
  CVector<T> operator / (T num) const;
  TIndex getSize() const;
  static CVector<T> minValues(const CVector<T> &v1, const CVector<T> &v2);
  static CVector<T> maxValues(const CVector<T> &v1, const CVector<T> &v2);
  static T dot(const CVector<T> &v1, const CVector<T> &v2);
  static string getClassName() {
    return "CVector";
  }
protected:
  TIndex size;
  void setSize(TIndex size);
};

#endif
